<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/JSTLFunction.tld" prefix="lotofn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>用户等级管理</title>
<c:import url="/ctrl/header"></c:import>
</head>
<body>
  <c:import url="/ctrl/top"></c:import>
  <div class="container">
    <div class="row-fluid">
      <c:import url="/ctrl/menu">
        <c:param name="pageId">
          <c:out value="${pageId}" />
        </c:param>
      </c:import>
      <!--/span-->
      <div class="span10">
        <h3 class="greybg">用户等级管理</h3>
        <table
          class="table table-bordered table-striped responsive-utilities table-hover">
          <thead>
            <tr>
              <th>等级名称</th>
              <th>等级折扣</th>
              <th>用户数</th>
              <th></th>
            </tr>
          </thead>
          <tbody>
            <c:forEach var="level" items="${levelList}">
              <tr id="tr_<c:out value="${level.levelId}" />">
                <td><c:choose>
                    <c:when test="${level.levelIsFixed=='1'}">
                      <c:out value="${level.levelName}" />
                    </c:when>
                    <c:otherwise>
                      <input
                        id="name_<c:out value="${level.levelId}" />"
                        name="name_<c:out value="${level.levelId}" />"
                        type="text"
                        value="<c:out value="${level.levelName}" />" />
                    </c:otherwise>
                  </c:choose></td>
                <td><input
                  id="discount_<c:out value="${level.levelId}" />"
                  name="discount_<c:out value="${level.levelId}" />"
                  type="text"
                  value="<c:out value="${level.levelDiscount}" />" /></td>
                <td><c:out value="${level.levelCount}" /></td>
                <td><input type="button" value="修改"
                  onclick="modifyLevel('<c:out value="${level.levelId}" />');" /></td>
              </tr>
            </c:forEach>
            <tr id="tr_new">
              <td><input id="lname" name="lname" type="text" /></td>
              <td><input id="discount" name="discount" type="text"
                value="1.5" /></td>
              <td></td>
              <td><input type="button" value="添加"
                onclick="addLevel();" /></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <hr />
    <c:import url="/ctrl/bottom"></c:import>
  </div>

  <c:import url="/ctrl/footer"></c:import>
</body>
</html>